package pl.moominek.ekosegragator;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class Start extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start);
	}
	
	@Override
	protected void onPause(){
		super.onPause();
		this.finish();
	}

	public void uruchomProgram(View view){
		 Intent intent = new Intent(this, A_Powitanie.class);
		 startActivity(intent);
	}
	
	public boolean onCreateOptionsMenu(Menu menu){
		super.onCreateOptionsMenu(menu);
		int base = Menu.FIRST;
		menu.add(base, base, base, getResources().getString(R.string.menu_opis_aplikacji));
		menu.add(base, base+1, base+1, getResources().getString(R.string.menu_regulamin));
		menu.add(base, base+2, base+2, getResources().getString(R.string.menu_strona_www));
		
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
//		Log.d("Uruchomiono menu nr:", "" + item);
		Intent intent = null;
		switch (item.getItemId())
		{
			case 1:  intent = new Intent(this, A_OProgramie.class); 
					 break;
			case 2:  intent = new Intent(this, A_Regualmin.class);
					 break;
			case 3:  intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/EkoSegregator"));
	
		}
		this.startActivity(intent);
	return true;
	}

}
